package com.tcs.tsrm.beans;

import java.util.ArrayList;
import java.util.Arrays;

public class MinDistCluster {
	private double[] clusterSig;
	private ArrayList<Integer> clusterMembers;

	public MinDistCluster(double[] eachRow) {
		clusterMembers = new ArrayList<Integer>();
		clusterMembers.add((int) eachRow[1]);
		clusterSig = Arrays.copyOfRange(eachRow, 2, eachRow.length);
	}

	public double[] getClusterSig() {
		return clusterSig;
	}

	public void setClusterSig(double[] clusterSig) {
		this.clusterSig = clusterSig;
	}

	public void addNewMember(double[] eachRow) {
		clusterMembers.add((int) eachRow[1]);

	}

	public String getSubsequences() {
		String out = "";
		for (int index : clusterMembers) {
			// out += index;
			double[] aRow = Cluster.originalMatrixHashMap.get(index);
			for (double d : aRow) {
				out += d + ",";
			}
			out += "\n";
		}
		return out;
	}

	public int getSupport() {
		return clusterMembers.size();
	}

}
